 <%--
 *  File:   DataLookedBottom.jsp
 * 
 *  Date	2011/5/22	
 *  Author	Kevinfan
 *
 *  Copyright (C) 2000 - 2011 Oval Technologies, Inc.
 *  All rights reserved.
 *
 *  This software is the confidential and proprietary information of Oval
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>
<%
  //init param
  String privilegeCode = "A0107";
  String strTableName = "v_zylpharmacypurchaseverifysummary";
  String strModuleName = "TDR";
  String contextPath = request.getContextPath();
%>
<%@ include file="/inc/CommonHeader.inc" %>
<%@ include file="/inc/OvalLocationDefault.inc" %>

<html>
<head>
<PageFlow:CheckPageFlow pageName="p_zylgetdatalooked"/>
<%
Vector summary = (Vector)pageContext.getAttribute("totalsummary");
if(summary == null)summary = new Vector(); 
%>
<%@ include file="/inc/CatchError.inc" %>
<%@ include file="/inc/SumDiv.inc" %>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="<%=contextPath%>/css/<%= strLanguageCode %>/main.css" type="text/css">
<script language="JavaScript" src="<%=contextPath%>/css/<%= strLanguageCode %>/script.js"></script>
<script language="JavaScript" src="<%=contextPath%>/js/ScriptLib.js"></script>
<script language="JavaScript" src="<%=contextPath%>/js/SummaryDivision.js"></script>
<script language="JavaScript" src="<%=contextPath%>/js/keyFunction.js"></script>
<script>
function page_summary(actionvalue,orderbyname)
{
  years = document.cform.years.value;
  months = document.cform.months.value;
  businesstype = document.cform.businesstype.value;
  statusstr = document.cform.status.value;
  regionid = document.cform.regionid.value;
  businessarealist = document.cform.businessarealist.value;
  proviceofficelist = document.cform.proviceofficelist.value;
  userids = document.cform.userids.value;
  var editform = summaryPrepare(cform,actionvalue,orderbyname);
  if(!editform) return;
  businesstype = document.cform.businesstype.value;
  editform.action = "Level2DealPurchase.jsp?<%= OvalTools.randomURL() %>&businesstype="+businesstype+"&years="+years+"&months="+months+"&status=" +statusstr+"&regionid="+regionid+"&businessarealist="+businessarealist+"&proviceofficelist="+proviceofficelist+"&userids="+userids;
  editform.target = "_self";
  isRunning = true;
  editform.submit();
}
</script>
</head>
<body>
<iframe id="reloadHandler" name="reloadHandler" style="display:none"></iframe>
<form name="cform" method="post" action="<%=contextPath%>/Dispatcher">
    <input type="hidden" name="pagename" value="p_zylgetdatalooked">
    <input type="hidden" name="actionname">
    <custom:hidden property="businesstype"/>
	<custom:hidden property="years"/>
	<custom:hidden property="months"/>
	<custom:hidden property="status"/>
	<custom:hidden property="regionid"/>
	<custom:hidden property="businessarealist"/>
	<custom:hidden property="proviceofficelist"/>
	<custom:hidden property="userids"/>
    <table width="100%" border="0" cellspacing="0">
      <tr>
        <td>
          <table width="3000" border="1" cellpadding="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" cellspacing="0" align="center">
	        <tr class="deepblue-left"> 
	          <td width="10">&nbsp;</td>
	          <td class="title_center" width="30" ><%= label.getLabelName("L_Month")%></td>
	          <td class="title_center" width="120" ><a href="javascript:page_summary('orderby','businessdate')"><%= label.getLabelName("L_BusinessFlowDate")%></a></td>
	          <td class="title_center" width="120" ><a href="javascript:page_summary('orderby','prarentareaname')"><%= label.getLabelName("L_Provicetdr")%></a></td>
	          <td class="title_center" width="120" ><a href="javascript:page_summary('orderby','dealercode')"><%= label.getLabelName("L_dealercode2") %></a></td>
	          <td class="title_center" width="120" ><a href="javascript:page_summary('orderby','dealername')"><%= label.getLabelName("L_orgname2")%></a></td>
	          <td class="title_center" width="120" ><a href="javascript:page_summary('orderby','vendorcode')"><%= label.getLabelName("L_DisBusiCode")%></a></td>
	          <td class="title_center" width="120" ><a href="javascript:page_summary('orderby','vendorname')"><%= label.getLabelName("L_SendBusinessName")%></a></td>
	          <td class="title_center" width="120" ><a href="javascript:page_summary('orderby','productcode')"><%= label.getLabelName("L_ProductCode")%></a></td>
	          <td class="title_center" width="120" ><a href="javascript:page_summary('orderby','productname')"><%= label.getLabelName("L_ProductName")%></a></td>
	          <td class="title_center" width="120" ><a href="javascript:page_summary('orderby','bunchno')"><%= label.getLabelName("L_LotNumber")%></a></td>
	          <td class="title_center" width="120" ><a href="javascript:page_summary('orderby','password')"><%= label.getLabelName("L_Password")%></a></td>
	          <td class="title_center" width="120" ><a href="javascript:page_summary('orderby','flowqty')"><%= label.getLabelName("L_BusiFlowPurchase")%></a></td>
	          <td class="title_center" width="120" ><a href="javascript:page_summary('orderby','notflowqty')"><%= label.getLabelName("L_NotFlowQty")%></a></td>
			  <td class="title_center" width="120" ><a href="javascript:page_summary('orderby','specifications')"><%= label.getLabelName("L_amount")%></a></td>
	          <td class="title_center" width="120" ><a href="javascript:page_summary('orderby','price')"><%= label.getLabelName("L_Spec")%></a></td>
	          <td class="title_center" width="120" ><a href="javascript:page_summary('orderby','amount')"><%= label.getLabelName("L_UnitPrice")%></a></td> 	           
	          <td class="title_center" width="120" ><a href="javascript:page_summary('orderby','salesman')"><%= label.getLabelName("L_BusinessManNum")%></a></td>
	          <td class="title_center" width="120" ><a href="javascript:page_summary('orderby','salesmanname')"><%= label.getLabelName("L_BusinessMan")%></a></td>
	          <td class="title_center" width="120" ><a href="javascript:page_summary('orderby','parentemployeecode')"><%= label.getLabelName("L_ManagerManNum")%></a></td>
	          <td class="title_center" width="120" ><a href="javascript:page_summary('orderby','parentemployeename')"><%= label.getLabelName("L_ManagerMan")%></a></td>
	          <td class="title_center" width="120" ><a href="javascript:page_summary('orderby','cityname')"><%= label.getLabelName("L_City")%></a></td>
	          <td class="title_center" width="120" ><a href="javascript:page_summary('orderby','description')"><%= label.getLabelName("L_Remarks")%></a></td>
	          <td class="title_center" width="120" ><a href="javascript:page_summary('orderby','status')"><%= label.getLabelName("L_Status")%></a></td>
	        </tr> 
	        <tbody> 
	          <%
	            Integer nDefaultId = new Integer(-1);
	            int i=0;
	            String strChecked = "";
	            String strClassType = "none";
	            boolean bHasChecked = false;
	          %>
	          <logic:iterate id="onerow" collection="<%= summary %>">
	          <%
	            if(i%2 == 1){
	              strClassType = "td-listrom";
	            }else{
	              strClassType = "none";
	            }
	          if(!bHasChecked){
	              bHasChecked = true;
	              strChecked = "Checked";
	            }else{
	              strChecked = "";
	            }
	            i++;
	          %>
	          <tr onMouseOver="this.className='tr-over'" onMouseOut="this.className='<%=JspHelper.filterNull( strClassType )%>'" class="<%=JspHelper.filterNull( strClassType )%>">
	            <td><%=i%></td>
	            <td><custom:write name="onerow" property="month" nbsp="true"/></td>
	            <td><custom:write name="onerow" property="businessdate" nbsp="true"/></td>
	            <td><custom:write name="onerow" property="prarentareaname" nbsp="true"/></td>
	            <td><custom:write name="onerow" property="dealercode" nbsp="true"/></td>
	            <td><custom:write name="onerow" property="dealername" nbsp="true"/></td>
	            <td><custom:write name="onerow" property="vendorcode" nbsp="true"/></td>
	            <td><custom:write name="onerow" property="vendorname" nbsp="true"/></td>
	            <td><custom:write name="onerow" property="productcode" nbsp="true"/></td>
	            <td><custom:write name="onerow" property="productname" nbsp="true"/></td>
	            <td><custom:write name="onerow" property="bunchno" nbsp="true"/></td>
	            <td><custom:write name="onerow" property="password" nbsp="true"/></td>
	            <td><custom:write name="onerow" property="flowqty" nbsp="true"/></td>
	            <td><custom:write name="onerow" property="notflowqty" nbsp="true"/></td>
				<td><custom:write name="onerow" property="amount" nbsp="true"/></td>
	            <td><custom:write name="onerow" property="specifications" nbsp="true"/></td>
	            <td><custom:write name="onerow" property="price" nbsp="true"/></td>	            
	            <td><custom:write name="onerow" property="salesman" nbsp="true"/></td>
	            <td><custom:write name="onerow" property="salesmanname" nbsp="true"/></td>
	            <td><custom:write name="onerow" property="parentemployeecode" nbsp="true"/></td>
	            <td><custom:write name="onerow" property="parentemployeename" nbsp="true"/></td>
	            <td><custom:write name="onerow" property="cityname" nbsp="true"/></td>
	            <td><custom:write name="onerow" property="description" nbsp="true"/></td>
	            <td><custom:write name="onerow" dictType="ZylStatus" property="status" nbsp="true"/></td>
	          </tr>
	          </logic:iterate>
	        </tbody> 
	        <tfoot> 
	        <tr> 
	          <td colspan="12" style="text-align:right"><%=label.getLabelName("L_PageSum") +  label.getLabelName("L_Colon")%></td>
				<td class="red"><custom:write name="sumhash" property="sumflowqty" nbsp="true"/></td>
				<td class="red"><custom:write name="sumhash" property="sumnotflowqty" nbsp="true"/></td>
				<td class="red"><custom:write name="sumhash" property="sumamount" nbsp="true"/></td>
			  <td colspan="9"> &nbsp;&nbsp;&nbsp; </td>
	        </tr>
	        	   <tr> 
	          <td colspan="12" style="text-align:right"><%=label.getLabelName("L_TotalSum") +  label.getLabelName("L_Colon")%></td>
				<td class="red"><b><custom:write name="sumhash" property="buyalldataflowqty" nbsp="true"/></b></td>
				<td class="red"><b><custom:write name="sumhash" property="buyalldatanotflowqty" nbsp="true"/></b></td>
				<td class="red"><b><custom:write name="sumhash" property="buyalldataamount" nbsp="true"/></b></td>
			 <td colspan="9">
	         <%@ include file="/inc/SummaryAction.inc" %>
	          </td>
	        </tr>
	        </tfoot> 
	      </table>
        </td>
      </tr>
    </table>
</form>
</body>
</html>